<%--
  Created by IntelliJ IDEA.
  User: 17710
  Date: 2020/10/12
  Time: 11:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

    <title>$Title$</title>
    <%@ include file="/pages/common/head.jsp" %>

    <script>
        function fun() {
            $.ajax({
                url: "http://localhost:8080/Work_war_exploded/NoticeServlet",
                data: {action: "queryNotice2"},
                type: "POST",
                success: function (data) {
                    var jsonObj = JSON.parse(data);
                    var str = "";
                    $.each(jsonObj, function (index, notice) {
                        str += "<tr align=\"center\">" +
                            "<td colspan=\"4\">" + notice.title + "</td>" +
                            "<td><a href='NoticeServlet?action=queryNoticeById&id=" + notice.id + "'> 查看</td> </tr>";

                    })
                    $("#tbody").html(str);
                    // $("#title1").html("标题："+jsonObj[0].title)
                },
                dataType: "text"
            });
        }

        $(function () {
        });
    </script>
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
            background-color: honeydew;
        }

        .navbar {
            margin: 0 auto;
            width: 100%;
        }

        .jumbotron {
            height: 360px;
            text-align: center;
        }

        .deng {
            position: relative;
            text-align: center;
            top: 70px;
        }

        .part2 {
            width: 100%;
            height: 500px;
            /* border: 1px solid red; */
            position: relative;

        }

        #bottom {
            width: 100%;
            height: 180px;
            position: relative;
            top: 200px;
            background-color: #2A2730;
            color: #FFFFFF;
        }

        #bottom p {
            text-align: center;
        }
    </style>
</head>
<body onload="fun()">
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">&nbsp;&nbsp;&nbsp;作业棒&nbsp;&nbsp;&nbsp;</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">


            <ul class="nav navbar-nav navbar-right">
                <li class="active"><a href="index.jsp">首页 <span class="sr-only">(current)</span></a></li>
                <li><a href="pages/user/login.jsp">&nbsp;&nbsp;&nbsp;登录&nbsp;&nbsp;&nbsp;</a></li>
                <li><a href="pages/user/regist.jsp">&nbsp;&nbsp;&nbsp;注册&nbsp;&nbsp;&nbsp;</a></li>

            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="jumbotron">
    <div class="a">
        <h1>欢迎来到作业棒</h1>
        <p>——一个为带学生服务的作业系统</p>
    </div>
    <div class="deng"><p><a class="btn btn-primary btn-lg" href="pages/user/login.jsp" role="button">暂未登录点击登录</a></p>
    </div>
</div>
<div class="part2">

    <table class="table table-hover">
        <thead align="center">
        <tr>
            <td colspan="5"><h3>公告板</h3></td>
        </tr>
        </thead>
        <tbody id="tbody">

        </tbody>
        <%--      <tr align="center">--%>

        <%--        <td colspan="4">标题</td>--%>
        <%--        <td>查看</td>--%>
        <%--      </tr>--%>
        <%--      <tr align="center">--%>
        <%--        <td colspan="4" id="title1"></td>--%>
        <%--        <td>查看</td>--%>
        <%--      </tr>--%>


    </table>


</div>
<%@include file="/pages/common/footer.jsp" %>
</body>
</html>
